package cn.melon.view.admin.library.ctr;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import cn.melon.mod.library.LibraryBooksInfo;
import cn.melon.view.admin.library.BookInfoDialog;
import cn.melon.view.admin.library.LibraryJPanel;

public class LibraryTableMouse extends MouseAdapter {

    private BookInfoDialog dialog = null;
    private LibraryJPanel panel = null;
    
    public LibraryTableMouse(LibraryJPanel panel){
        this.panel = panel;
    }
    
    @Override
    public void mouseClicked(MouseEvent e){
        if(e.getClickCount() == 2){
            LibraryBooksInfo book = panel.getTableRowBook();
            dialog = new BookInfoDialog(book, panel);
            dialog.setVisible(true);
        }
    }
}